<?php
include('../../__global.php');

class aj_collectionList extends ml_controller {

    private $uid;
    private $name;
    private $descrip;

    function initParam() {
        $this->uid=$this->__visitor['uid'];

    }

    function checkParam() {

        $this->check_referer();
        if ($this->check_permission(ML_PERMISSION_LOGOUT_ONLY)) {
            $this->api_output(ML_RCODE_NOLOGIN);
        }

        if ($this->check_permission(ML_PERMISSION_UNVERIFY_ONLY)) {
            $this->api_output(ML_RCODE_NOACTIVE);
        }

        if (!ml_tool_isuid::is_mluid($this->uid)) {
            $this->api_output(ML_RCODE_PARAM,'','wrong uid');
        }

    }

    public function main() {

        $model=new ml_model_dbCollectionBox();
        $data=$model->beforeRepost($this->uid);
        if(!$data){
            $this->api_output(ML_RCODE_SUCC,array());
        }
        else{
            $this->api_output(ML_RCODE_SUCC,$data);

        }
    }


}

new aj_collectionList();